package com.lm.scau.dyb.utils;

import android.content.Context;
import android.view.LayoutInflater;
import android.widget.ImageView;

import com.lm.scau.dyb.R;
import com.nostra13.universalimageloader.core.ImageLoader;

/**
 * Function:
 * auth：liming on 2016/8/23 13:48
 * mail：liming@wxchina.com
 */
public class ImageLoaderUtil {
    /**
     * 获取一个加载了图片的imageView
     *
     * @param context
     * @param url
     * @return
     */
    public static ImageView getImageView(Context context, String url) {
        ImageView imageView = (ImageView) LayoutInflater.from(context).inflate(
                R.layout.view_banner, null);
        ImageLoader.getInstance().displayImage(url, imageView);
        return imageView;
    }

    public static ImageView getImageView( String url, ImageView imageView) {
        ImageLoader.getInstance().displayImage(url, imageView);
        return imageView;
    }
}
